SET NOCOUNT ON

DECLARE @product_id int, @product_name nvarchar(50),
    @listprice money

-- Declare the cursor

DECLARE product_cursor CURSOR FOR 
SELECT ProductID, Name, ListPrice
FROM Production.Product
ORDER BY ProductID FOR UPDATE

OPEN product_cursor

FETCH NEXT FROM product_cursor 
INTO @product_id, @product_name, @listprice

WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE Production.Product
SET ListPrice = 39.99
    
    FETCH NEXT FROM product_cursor 
    INTO @product_id, @product_name, @listprice
END 
CLOSE product_cursor
DEALLOCATE product_cursor